home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / biz / haage / WarpUP_V31.lha / WarpUP-WarpOS / WarpRace / ModSrc / ContextSwitch / pixelomania.p < prev    next >
Text File  |  1997-09-24  |  3KB  |  89 lines

  1.                 incdir  include:
  2.                 incdir  lvo:
  3.                 incdir  powerasm:source/powerpc_lib/warprace/
  4.  
  5. **      '(C) Copyright 1997 Haage & Partner Computer GmbH'
  6. **           All Rights Reserved
  7.  
  8.                 include intuition/intuition.i
  9.                 include powerpc/ppcmacros.i
  10.                 include powerpc/powerpc.i
  11.                 include warprace.i
  12.  
  13.                 include exec_lib.i
  14.                 include graphics_lib.i
  15.                 include powerpc_lib.i
  16.  
  17.                 xref    _SysBase
  18.                 xref    _GfxBase
  19.                 xref    _PowerPCBase
  20.                 xref    _Window
  21.  
  22.                 xdef    PixelOMania_PPC
  23.  
  24.                 smalldata
  25.                 escapestr
  26.  
  27.                 section code
  28.  
  29.  
  30. ;In:  r5 -> WRI structure
  31. ;Out: r3 -> Result time or NULL
  32.  
  33. PixelOMania_PPC
  34.                 prolog
  35.                 pushgpr r25-r31
  36.                 lw      r3,_Window
  37.                 mr      r25,r5
  38.                 lwz     r31,wd_UserPort(r3)
  39.                 lwz     r29,wd_RPort(r3)
  40.                 li      r30,0
  41.                 li      r28,0
  42.                 li      r27,0
  43.                 li      r26,1
  44.                 lwz     r3,WRI_STARTTIMER_PPC(r25)
  45.                 mtlr    r3
  46.                 lwz     r3,WRI_LINKERDB(r25)
  47.                 blrl
  48. .loop
  49.                 mr      r5,r31
  50.                 RUN68K  _SysBase,GetMsg
  51.                 tstw    r3
  52.                 beq     .nomsg
  53.                 lwz     r4,im_Class(r3)
  54.                 liw     r5,IDCMP_MOUSEBUTTONS
  55.                 and.    r4,r4,r5
  56.                 beq     .nomsg
  57.                 li      r30,-1
  58.                 mr      r6,r3
  59.                 RUN68K  _SysBase,ReplyMsg
  60. .nomsg
  61.                 tstw    r30
  62.                 bne     .abort
  63.                 mr      r6,r29
  64.                 mr      r3,r26
  65.                 xori    r26,r26,2
  66.                 RUN68K  _GfxBase,SetAPen
  67.                 mr      r6,r29
  68.                 mr      r3,r27
  69.                 mr      r4,r28
  70.                 RUN68K  _GfxBase,WritePixel
  71.                 addi    r27,r27,1
  72.                 cmplwi  r27,96
  73.                 blt     .loop
  74.                 li      r27,0
  75.                 addi    r28,r28,1
  76.                 cmplwi  r28,64
  77.                 blt     .loop
  78.                 lwz     r3,WRI_STOPTIMER_PPC(r25)
  79.                 mtlr    r3
  80.                 lwz     r3,WRI_LINKERDB(r25)
  81.                 blrl
  82.                 b       .exit
  83. .abort
  84.                 li      r3,0
  85. .exit
  86.                 popgpr
  87.                 epilog
  88.  
  89.